const routerList = [
  {
    id: 1,
    url: "/",
    component: "layout",
    redirect: "/home",
    parentId: 0
  },
  {
    id: 99,
    url: "404",
    component: "404",
    parentId: 1
  },
  {
    id: 88,
    url: "home",
    component: "home",
    parentId: 1
  },
  {
    id: 2,
    url: "buyer",
    name: "buyer",
    // redirect: "404",
    component: "authLayout",
    parentId: 1,
    title: "买家中心",
    icon: "sales1"
  },
  {
    id: 3,
    url: "seller",
    name: "seller",
    component: "authLayout",
    // redirect: "404",
    parentId: 1,
    title: "卖家中心",
    icon: "sales1"
  },
  {
    id: 4,
    url: "order",
    name: "sellerMallOrder",
    component: "contentLayout",
    parentId: 3,
    title: "商城销售订单",
    icon: "sales1"
  },
  {
    id: 5,
    url: "pricing",
    name: "sellerPricingOrder",
    component: "order/list",
    parentId: 4,
    title: "点价销售订单"
  },
  {
    id: 6,
    url: "pricing/detail",
    name: "sellerPricingOrderDetail",
    component: "order/detail",
    parentId: 4,
    title: "点价销售订单详情",
    hidden: true,
    menuName: "sellerPricingOrder"
  },
  {
    id: 7,
    url: "contract",
    name: "sellerContract",
    component: "contract/list",
    parentId: 3,
    title: "销售合同",
    icon: "hetongdingdan"
  },
  {
    id: 8,
    url: "order",
    name: "buyerMallOrder",
    component: "contentLayout",
    parentId: 2,
    title: "商城采购订单",
    icon: "sales1"
  },
  {
    id: 9,
    url: "pricing",
    name: "buyerPricingOrder",
    component: "order/list",
    parentId: 8,
    title: "点价采购订单",
    icon: "hetongdingdan"
  },
  {
    id: 10,
    url: "contract",
    name: "buyerContract",
    component: "contract/list",
    parentId: 2,
    title: "采购合同",
    icon: "hetongdingdan"
  },
  {
    id: 11,
    url: "confirm",
    name: "buyerConfirmOrder",
    component: "order/list",
    parentId: 8,
    title: "确定价采购订单",
    icon: "hetongdingdan"
  },
  {
    id: 12,
    url: "certification",
    name: "certification",
    component: "certification",
    parentId: 1,
    title: "身份认证"
  },
  {
    id: 13,
    url: "enterprise",
    name: "enterprise",
    component: "authLayout",
    parentId: 1,
    title: "企业管理"
  },
  {
    id: 14,
    url: "staff/apply",
    name: "staffApply",
    component: "staff/apply",
    parentId: 13,
    title: "员工申请"
  },
  {
    id: 15,
    url: "staff/manage",
    name: "staffManage",
    component: "staff/manage",
    parentId: 13,
    title: "员工管理"
  },
  {
    id: 16,
    url: "admin/transfer",
    name: "transferAdmin",
    component: "transfer-admin",
    parentId: 13,
    title: "更换超级管理员"
  }
];

const buttons = [
  {
    url: "seller",
    flag: ["view", "add", "edit", "del"]
  },
  {
    url: "sellerOrderList",
    flag: ["view"]
  },
  {
    url: "buyer",
    flag: ["view"]
  }
];

export default {
  "post|/getRouter": () => {
    return {
      code: 0,
      data: {
        routerList: routerList
      }
    };
  },
  "post|/getButtons": () => {
    return {
      code: 0,
      data: {
        buttons: buttons
      },
      msg: "成功"
    };
  }
};
